<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/2/4
 * Time: 13:32
 */

namespace iBrand\Shop\Server\Providers;

use Dingo\Api\Transformer\Adapter\Fractal;
use iBrand\Shop\Server\Http\Middleware\ClerkMiddleware;
use iBrand\Shop\Server\Serializer\DataArraySerializer;
use iBrand\Shop\Server\Listeners\LogSuccessfulLogin;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use League\Fractal\Manager;
use Event;

class ServerServiceProvider extends ServiceProvider
{
    protected $listen = [
        'Illuminate\Auth\Events\Login' => [
            LogSuccessfulLogin::class,
        ],
    ];

    public function boot()
    {
        foreach ($this->listen as $event => $listeners) {
            foreach ($listeners as $listener) {
                Event::listen($event, $listener);
            }
        }
    }

    public function register()
    {
        $app = $this->app;

        $app->register(\iBrand\Shop\Core\ServiceProvider::class);
        $app->register(RouteServiceProvider::class);
    }
}